package cn.lhd.intentapp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void onClickSendMessage(View view){
//        Intent intent = new Intent(this, ReceiverActivity.class);
        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setType("text/plain");
        intent.putExtra(Intent.EXTRA_SUBJECT, "Hello");

        Intent chosenIntent = Intent.createChooser(intent, "Intent Chooser");
        startActivity(intent);
        startActivity(chosenIntent);

    }
}
